package com.gzx.risk.core.apis.result.yuyao;

import com.gzx.risk.core.apis.result.RiskResult;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * {"code":0,"msg":"操作成功","data":{"hit":1,"info":{"xyp_t01aazhzz":"1","xyp_t01abdzbz":""}}}
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class YuyaoGatewayC108144 extends RiskResult {
	private int code;
	private String msg;
	private YuyaoGatewayC108144Data data;

	public String getValue(String key) {
		if (data == null) {
			return "";
		}
		if (data.getHit() != 1) {
			return "";
		}
		if (data.getInfo() == null) {
			return "";
		}
		if (data.getInfo().containsKey(key)) {
			return data.getInfo().get(key).toString();
		} else {
			return "";
		}
	}

	public Double getNum(String key) {
		String value = getValue(key).trim();
		if (value.length() > 0) {
			return Double.valueOf(value);
		} else {
			return -1.0;
		}
	}

}
